package wzc.design_pattern.creation.factory.simple_factory;

import java.util.Scanner;

/**
 * @Author 王振川
 * @Date 2025/7/19
 */

public class SimpleFactoryDemo {
    public static void main(String[] args) {
        String type;
        System.out.println("请输入使用产品类型");
        Scanner input = new Scanner(System.in);
        type = input.nextLine();
        Product product = SimpleFactory.createProduct(type);
        if (product != null) {
            product.use();
        } else {
            System.out.println("没有该类型得产品");
        }
    }
}
